package cn.shiva.springaop.config;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author shiva   2022-09-15 13:40
 */
@Slf4j
@Aspect
@Order(1)
@Component
public class AnnotationAspect {
    @Pointcut("@annotation(cn.shiva.springaop.config.LogAspect)")
    public void annotationPointCut() {
    }

    @Before("annotationPointCut()")
    public void before() {
        log.info("XXXX.注解切入的前置通知，方法执行之前。还加了Order(1)，在正常前置之前");
    }
}
